<template>
  <div class="register-page">
    <div class="register-title">
      开通伯汉邮箱
    </div>
    <div class="register-content">
      <p>创建账号</p>
      <p>设置密钥密码</p>
      <a-form
          :model="formState"
          name="basic"
          :wrapper-col="{ span: 24 }"
          :rules="rules"
          layout="vertical"
          autocomplete="off"
          class="register-form"
          @finish="onFinish"
          @finishFailed="onFinishFailed"
      >
        <a-form-item label="账号(GUID)" name="username" class="username-input">
          <a-input v-model="formState.username" placeholder="请输入账号（guid）"/>
        </a-form-item>

        <a-form-item
            label="密码"
            name="password"
            class="password-input"
        >
          <a-input-password v-model="formState.password" placeholder="请输入密码"/>
        </a-form-item>
        <a-form-item class="btn-wrapper">
          <a-button type="primary" html-type="submit" class="submit-btn">注册</a-button>
          <div class="protocol-wrapper">
            <a-checkbox v-model:checked="agreeChecked"></a-checkbox>
            阅读并接受 <a>《服务条款》</a>和 <a>《隐私政策》</a>
          </div>
        </a-form-item>
      </a-form>
    </div>
    <p class="tip">
      <span>©Copyright</span>  2021 Bohan-IT 上海伯汉信息技术有限公司版权所有本站内容禁止擅自转载，复制，引用。
    </p>
  </div>
</template>

<script setup>
import { reactive, ref} from "vue";

const agreeChecked = ref(false)

const formState = reactive({
  username: "",
  password: "",
});

const rules = {
  username: [{ required: true, message: '账号必填' }],
  password: [{ required: true, message: '密码必填' }],
}

// 校验成功
function onFinish() {}

// 校验失败
function onFinishFailed() {}
</script>

<style lang="less" scoped>
.register-title{
  font-size: 30px;
  font-weight: 600;
  padding: 32px 0;
}
.register-page{
  display: flex;
  align-items: center;
  flex-direction: column;
  height: 100%;
}
.register-content{
  width: 800px;
  background: #FFFFFF;

  box-shadow: 0px 2px 10px 0px rgba(0,0,0,0.05);
  border-radius: 4px;
  padding: 40px;
  margin: 0 auto;
  .btn-wrapper :deep.ant-form-item-control{
    text-align: center;
  }
  .submit-btn{
    width: 100%;
    height: 40px;
    font-size: 16px;
    background: linear-gradient(270deg, #009496 0%, #00A098 55%, #00B09D 86%, #00C29F 100%);
    border-radius: 4px;
    width: 144px;
  }
  .register-wrapper{
    padding-top: 7px;
    text-align: right;
  }
  :deep(.ant-tabs-tab) {
    padding-top: 0;
    .ant-tabs-tab-btn{
      font-size: 22px;
      padding: 0 8px;
      position: relative;
      left: -4px;
    }
    & + .ant-tabs-tab{
      position: relative;
      left: 12px;
    }
  }
  :deep(.ant-tabs-ink-bar) {
    transform: translateX(-6px) ;
  }
  :deep(.ant-tabs-nav-list) {
    flex: 1;
    justify-content: space-around;
  }
  :deep(.ant-tabs-nav){
    margin-bottom: 0;
  }
  .username-input{
    margin-bottom: 12px;
    width: 200px;
  }
  .password-input{
    margin-bottom: 16px;
    width: 200px;
  }
  .btn-wrapper{
    margin-bottom: 0;
  }
  .protocol-wrapper{
    margin-top: 8px;
  }
  &>p{
    font-size: 16px;
    margin-bottom: 16px;
  }
  :deep(.ant-form-item-label > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before) {
    display: none;
  }
  :deep(.ant-form-item-label > label) {
    color: #666666;
  }
}
.tip{
  color: #A2A6B2;
  text-align: center;
  margin-top: 40px;
}

</style>
